var express=require("express");
var pool=require("../pool.js");
let router=express.Router();
router.get('/index_server',(req,res)=>{
  var sql="select * from xhy_server";
  pool.query(sql,(err,result)=>{
    if(err) throw err;
    res.json(result);
  })
})

router.get('/index_carousel',(req,res)=>{
  var sql="select * from xhy_carousel";
  pool.query(sql,(err,result)=>{
    if(err) throw err;
    res.json(result);
  })
})

router.get('/index_store',(req,res)=>{
  var sql="select * from xhy_store where sale_store>100";
  pool.query(sql,(err,result)=>{
    if(err) throw err;
    res.json(result);
  })
})

router.get('/index_product',(req,res)=>{
  var sql="select * from xhy_product";
  pool.query(sql,(err,result)=>{
    if(err) throw err;
    res.json(result);
  })
})

module.exports=router;